import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument, Document } from 'mongoose';

export type TagDocument = HydratedDocument<Tag>;

@Schema({ timestamps: true })
export class Tag extends Document {
  @Prop({ required: true, length: 10, unique: true })
  name: string;

  @Prop({ required: true, length: 3, default: 1 })
  type: number;

  @Prop({ length: 100 })
  desc: string;

  // @Prop()
}

export const TagSchema = SchemaFactory.createForClass(Tag);
